package com.languohui.lgh.client;

import com.languohui.lgh.client.impl.RedisClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Primary
@FeignClient(value = "REDIS-SERVICE",path = "/redis",fallback = RedisClientFallback.class)
public interface RedisClient {

    /**
     * 设置值
     * @param key
     * @param value
     */
    @PostMapping("/setValue")
    public void setValue(@RequestParam("key") String key, @RequestParam("value") String value);

    /**
     * 获取值
     * @param key
     */
    @GetMapping("/getValue")
    public String getValue(@RequestParam("key") String key);
}
